package com.candy.service.impl;

import com.candy.bean.UserInfo;
import com.candy.dao.UserInfoMapper;
import com.candy.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    UserInfoMapper userInfoMapper;
    /**
     * 登录操作的业务逻辑
     * @param userInfo 用户登录的信息
     * @return 用户信息与数据库中的信息匹配，返回true，不匹配返回fasle
     */
    @Override
    public boolean login(UserInfo userInfo) {
       UserInfo userInfo1= userInfoMapper.login(userInfo);
       if(userInfo1!=null){
           return true;
       }else {
           return false;
       }
    }
}
